namespace Velocity4Net.Runtime.Parse.AST
{
    using System;
    using Parser = Velocity4Net.Runtime.Parse.Parser;
    using MethodInvocationException = Velocity4Net.Errors.MethodInvocationException;
    using InternalContextAdapter = Velocity4Net.Ctx.InternalContextAdapter;

    public class ASTExpression : SimpleNode
    {
        public ASTExpression(int id) : base(id) { }

        public ASTExpression(Parser p, int id) : base(p, id) { }


        /**
         * @see org.apache.velocity.runtime.parser.node.SimpleNode#jjtAccept(org.apache.velocity.runtime.parser.node.ParserVisitor, java.lang.Object)
         */
        public Object jjtAccept(ParserVisitor visitor, Object data)
        {
            return visitor.visit(this, data);
        }

        /**
         * @see org.apache.velocity.runtime.parser.node.SimpleNode#evaluate(org.apache.velocity.context.InternalContextAdapter)
         */
        public override bool Evaluate(InternalContextAdapter context)
        {
            return jjtGetChild(0).Evaluate(context);
        }

        /**
         * @see org.apache.velocity.runtime.parser.node.SimpleNode#value(org.apache.velocity.context.InternalContextAdapter)
         */
        public override Object GetValue(InternalContextAdapter context)
        {
            return jjtGetChild(0).GetValue(context);
        }
    }

}
